import AMapLoader from '@amap/amap-jsapi-loader';


//构造地图
export default function (config = {}) {

  if (config.serviceHost) {
    (window)._AMapSecurityConfig = {
      serviceHost: config.serviceHost
    };
  } else if (config.securityJsCode) {
    (window)._AMapSecurityConfig = {
      securityJsCode: config.securityJsCode
    };
  }
  return AMapLoader.load(config);
}
